let request = require("request");
let fs = require("fs")
let key = "ZXGBZ-MQFLG-WVPQZ-IXUPH-OIQQO-RSBKU";
//get请求
let wdata = fs.readFileSync("aaa",'utf-8');
let url = 'https://apis.map.qq.com/ws/geocoder/v1/?location=39.984154,116.307490&get_poi=1&key=';
request(url+key, function (error, response, body) {
    if (!error && response.statusCode === 200) {
        let jsonbody = JSON.parse(body)
        fs.writeFile('aaa', jsonbody.result.ad_info.name+'\n', { 'flag': 'a' },function(error){
          if(error){
              throw error;
          }
        })
    }
});